package cz.wql.service.imp;

import cz.wql.dao.CustomerMapper;
import cz.wql.domain.Customer;

import cz.wql.service.CustomerService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional
public class CustomerServiceimp  implements CustomerService {
@Resource
private CustomerMapper customerMapper;
    @Override
    public List<Customer> findCustomerlist() {

      return customerMapper.findCustomerlist();
    }

    @Override
    public void insert(Customer customer) {
        customerMapper.insert(customer);
    }

    @Override
    public void del(Long custId) {
        customerMapper.deleteByPrimaryKey(custId);
    }
//修改回显
    @Override
    public Customer showedit(Long custId) {
        return customerMapper.selectByPrimaryKey(custId);
    }

    @Override
    public void update(Customer customer) {
        customerMapper.updateByPrimaryKey(customer);
    }
}
